package ch.elca.lol.puissance4;

import ch.elca.lol.puissance4.board.Board;
import ch.elca.lol.puissance4.board.FastImBoard;
import ch.elca.lol.puissance4.game.Game;
import ch.elca.lol.puissance4.game.PlayerLoader;
import ch.elca.lol.puissance4.player.Player;
import ch.elca.lol.puissance4.player.RandomAI;
import ch.elca.lol.puissance4.player.ui.UIPlayer;

public class Puissance4 {
	public static void main(String... args) {
		Board b = new FastImBoard(7, 6);
		
		Player p1 = null;
		Player p2 = null;
		if(args.length >= 1) {
			p1 = PlayerLoader.loadPlayer(args[0]);
		}
		if(args.length >= 2) {
			p2 = PlayerLoader.loadPlayer(args[1]);
		}
		
		// Fall back to defaults in case a player couldn't be instantiated
		if(p1 == null) {
			p1 = new UIPlayer();
		}
		
		if(p2 == null) {
			p2 = new RandomAI();
		}
		
		new Game(p1, p2, b).play();
	}
}
